# -*- coding: utf-8 -*-
# @Time    : 2023/6/5 17:18
# @Author  : hyh
# @Email   : 935887145@qq.com
# @File    : delete_work_page.py
# @Software: PyCharm
from pages.base_page import BasePage
from appium import webdriver
from tools import driver
from appium.webdriver.common.mobileby import MobileBy as By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import  expected_conditions as EC

class DeleteWorkPage(BasePage):
    picture_locator = (By.XPATH,'//*[@resource-id="com.xiachufang:id/rv_course_review"]/android.widget.FrameLayout[1]')
    more_locator = (By.XPATH,'//*[@resource-id="com.xiachufang:id/common_control_panel_more_btn"]')
    delete_locator = (By.XPATH,'//android.widget.TextView[@resource-id=\"android:id/text1\" and @text=\"删除\"]')
    sure_locator = (By.XPATH,'//android.widget.Button[@resource-id=\"android:id/button1\"]')
    tishi_locator =(By.XPATH,'//android.widget.TextView[@resource-id=\"com.xiachufang:id/load_status_top_text\"]')
    def click_picture(self):
        self.find_element(self.picture_locator).click()  #点击作品内的图片
    def click_more(self):
        self.find_element(self.more_locator).click()  #点击右上角三个点
    def click_delete(self):
        self.find_element(self.delete_locator).click() #点击删除按钮
    def clcik_sure(self):
        self.find_element(self.sure_locator).click() #点击确认删除
    def get_tishi(self):
        current_tishi = self.find_element(self.tishi_locator).get_attribute('text')
        return current_tishi

